/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.quangtin3;

import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * Small Util.
 * @author quangtin3@gmai.com
 */
public class Utils {

    private static SimpleDateFormat sd = new SimpleDateFormat("yy-MM-dd hh:mm:ss");
    private static Calendar cal = Calendar.getInstance();

    public static String getString(char[] cbuff, int len) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < len; i++) {
            sb.append(cbuff[i]);
        }

        return sb.toString();
    }

    public static String getCurDate() {
        return sd.format(cal.getTime());
    }
}
